package cn.edu.tju.cas.dao.impl;

import cn.edu.tju.cas.dao.BaseDao;
import cn.edu.tju.cas.dao.SystemDao;
import cn.edu.tju.cas.entity.SystemEntity;
import cn.edu.tju.cas.entity.UserEntity;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by catold on 16/2/25.
 */
@Repository("systemDao")
public class SystemDaoImpl extends BaseDaoImpl<SystemEntity> implements SystemDao {
    public SystemDaoImpl(){
        super();

        setClass(SystemEntity.class);
    }

    @Override
    public SystemEntity findByKey(String key) {
        return getOneFromList(getHibernateTemplate().find("from SystemEntity where key=?", key));
    }

}
